From: Brion Vibber Date: Sun, 8 May 2005 23:48:40 +0000 (+0000) Subject: Clean up makeFlatExifTags; a simple foreach loop is a little easier on the X-Git-Tag: 1.5.0alpha2~252 X-Git-Url: http://git.cyclocoop.org/wiki/%27.%24skin%5B%27img%27%5D.%27?a=commitdiff_plain;h=1872ab1632353cdb8a73e99d3b7de1f4060d3469;p=lhc%2Fweb%2Fwiklou.git Clean up makeFlatExifTags; a simple foreach loop is a little easier on the eyes than the array_walk bit, and seems to explode and die less on PHP 5. --- diff --git a/includes/Exif.php b/includes/Exif.php index e475771f63..3e57697d09 100644 --- a/includes/Exif.php +++ b/includes/Exif.php @@ -279,19 +279,22 @@ class Exif { */ function makeFlatExifTags() { $exif = $this->getExif(); - array_walk($exif, array(&$this, 'callback')); // note the reference + $this->extractTags( $exif ); } /** - * A callback function used by makeFlatExifTags() + * A recursing extractor function used by makeFlatExifTags() */ - function callback($val, $key) { - if (gettype($val) === 'array') - array_walk($val, array(&$this, 'callback')); - else - $this->mFlatExif[$key] = $val; + function extractTags( $tagset ) { + foreach( $tagset as $key => $val ) { + if( is_array( $val ) ) { + $this->extractTags( $val ); + } else { + $this->mFlatExif[$key] = $val; + } + } } - + /** * Produce a list of all Exif tags appropriate for user output *